#include <iostream>
#include <asio.hpp>
#include <sigc++/sigc++.h>
#include <chrono>
#include <string>

std::chrono::seconds operator ""_s(unsigned long long n)
{
    return std::chrono::seconds(n);
}

int main(int, char**) {
    std::cout << "Hello, world!\n";

    sigc::signal<void(const std::string&)> signal_print;
    signal_print.connect(
        // sigc::ptr_fun(void
            [](const std::string& s){
                std::cout << "print: " << s << std::endl;
            }
        // )
    );

    asio::io_service io;
    // asio::io_service::work work(io);
    asio::steady_timer t(io, 5_s);
    std::cout << "steady_timer begin" << std::endl;
    t.async_wait([&](const std::error_code& ec) {
        std::cout << "async wait success" << std::endl;
        signal_print.emit("hello world");
    });
    std::cout << "steady_timer end" << std::endl;
    io.run();
}
